import { request } from "@/utils/service"
/**ZS Boolean true 为5G号卡 ，false 为 云尚号卡 */
import { getToken } from "@/utils/cache/cookies"
import axios from "axios"
const baseURL = import.meta.env.VITE_BASE_API
/** 查 */
export function getconfigurationRuleApi(params: any, ZS: boolean) {
  return request({
    url: ZS ? "/retail/cash/query" : "/retailys/cash/query",
    method: "get",
    params
  })
}

/** 增 */
export function getconfigurationRuleApiAdd(data: any, ZS: boolean) {
  return request({
    url: ZS ? "/retail/cash/add" : "/retailys/cash/add",
    method: "post",
    data
  })
}

/** 改 */
export function getconfigurationRuleApiUpdate(data: any, ZS: boolean) {
  return request({
    url: ZS ? "/retail/cash/update" : "/retailys/cash/update",
    method: "post",
    data
  })
}

/** 删 */
export function getconfigurationRuleApiDel(package_id: string, ZS: boolean) {
  return request({
    url: ZS ? "/retail/cash/del" : "/retailys/cash/del",
    method: "delete",
    params: {
      package_id
    }
  })
}
//  云商号卡佣金记录
export function getcashRecordqueryApi(params: any, ZS: boolean) {
  return request({
    url: ZS ? "/retail/cash/query" : "/retailys/cashRecord/query",
    method: "get",
    params
  })
}
// 下载
export function downLoadOrderTable(data: any) {
  return axios({
    url: `${baseURL}/retailys/cashRecord/queryExcel`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data,
    responseType: "blob"
  })
}
